<%--
  Created by IntelliJ IDEA.
  User: Jeck
  Date: 2010-2-8
  Time: 22:55:55
  To change this template use File | Settings | File Templates.
--%>

<%@ page contentType="text/html;charset=UTF-8" %>
<html>
  <head>
    <title>Simple GSP page</title>
    <link href="/site/default.css" rel="stylesheet" type="text/css" />
    <script language="javascript">
        var gtData,gtMap;
        function onLoad()//在页面初始化的时候执行本函数
        {
            SFAjax.loadXml("${resource(dir:'xml',file:'test.xml')}",onGanttLoaded);	//通过Ajax模式下载对应的XML文件，并在下载完成之后执行onDataLoaded函数
        }
        function onGanttLoaded(doc)	//doc参数是一个XML文件DOM对象
        {
            var gtConfig=new SFConfig();	//初始化一个页面上的配置对象
            gtConfig.setConfig("SFGantt/container","Div_Gantt");	//设置用来显示甘特图的层的ID
            gtData=new SFData(new SFDataProject(doc));	//将doc对象初始化为一个甘特数据对象
            gtMap=new SFGantt(gtConfig,gtData);	//用相应的数据对象和配置对象创建甘特对象
            gtMap.showMap(null,3);		//显示甘特图
        }
    </script>
    <script language="javaScript" src="${resource(dir:'js/gantt/js',file:'gantt.js')}" charset="utf-8"></script>
  </head>
  <body onload="onLoad()">
    <div id="Div_Gantt" style="position:relative;width:100%;height:100%;border:solid 1px #99cc00">
      
    </div>
  </body>
</html>